{extend name="../../../view/public/base" /}
{block name="css"}
<link rel="stylesheet" href="/layui/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
{/block}
{block name="body"}
<div style="padding: 20px; background-color: #F2F2F2;">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header"><i class="fa fa-connectdevelop"></i>小程序提交审核</div>
                <div class="layui-card-body">
                    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
                        <blockquote class="layui-elem-quote layui-text">
                            温馨提示：会提交您购买的小程序的对应的版本号的代码给微信官网进行审核。
                        </blockquote>

                        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                            <legend>需要审核的项目</legend>
                        </fieldset>

                        <form class="layui-form" action="">
                            <input type="hidden" name="id" value="{$id}" />
                            <div class="layui-form-item">
                                <label class="layui-form-label">请选择页面路径:</label>
                                <div class="layui-input-block">
                                    <select name="page[0]" lay-filter="required">
                                        <option value="">请选择页面路径</option>
                                        {foreach $page as $path} <option value="{$path}">{$path}</option>{/foreach}
                                    </select>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">页面名称</label>
                                <div class="layui-input-block">
                                    <input type="text" name="name[0]" lay-verify="required" autocomplete="off" placeholder="请输入名称，如商城首页" class="layui-input">
                                </div>
<!--                                <div class="layui-form-mid layui-word-aux">此处只是演示联动排版，并未做联动交互</div>-->
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">页面目录:</label>
                                <div class="layui-input-block">
                                    <select name="cate[0]" lay-filter="required">
                                        <option value="">请选择页面目录</option>
                                        {foreach $cate as $key => $vo }<option value="{$key}">{$vo.name}</option>{/foreach}
                                    </select>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">页面标签</label>
                                <div class="layui-input-block">
                                    <input type="text" name="tag[0]" lay-verify="required" autocomplete="off" placeholder="请输入标签，如购物" class="layui-input">
                                </div>
                                <div class="layui-form-mid layui-word-aux">多个标签用空格分隔，标签不能多于10个，标签长度不超过20</div>
                            </div>
                            <div class="layui-form-item">
                                <div class="layui-input-block">
                                    <button type="submit" class="layui-btn" lay-submit="" lay-filter="audit">立即提交</button>
                                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                                </div>
                            </div>
                        </form>

                    </div>
            </div>
        </div>
    </div>
</div>
</div>


{/block}

{block name="js"}

<script>
    var form;
    layui.use(['form', 'util'], function () {
        form = layui.form;
        form.on('submit(audit)', function (obj) {
            data = obj.field;
            var layerMsg = layer.load(1,{
                icon: 0, // 0~2 ,0比较好看
                shade: [0.5,'black'] // 黑色透明度0.5背景
            });
            //ajax调用后台接口
            bwajax.post("/manage/member/submitAudit?miniapp_id={$member_miniapp_id}", data)
                .then(function (response) {
                    layer.close(layerMsg); // 关闭单个
                    if (response.data.data.errcode === 0) {
                        var index = parent.layer.getFrameIndex(window.name);
                        layer.msg(response.data.msg, {icon: 1},function () {
                            parent.layer.close(index);
                        });
                    } else {
                        layer.msg(response.data.msg, {icon: 2});
                    }
                })
            return false;
        });

    })
</script>
{/block}